*******************************
* IRCA and Redistricting
* Navid Sabet and Noam Yuchtman
* Figure 2: IRCA and Democratic vote share (Presidential elections)
*******************************

	//Load data
	use irca_gerrymander.dta, clear
	
	
	//Fixed effects:
	global fe id congress#StateFIPS c.hisp_share1980#i.congress i.unassigned_county#i.congress 
	
	//Clustering
	global cluster id

	 
***********************
* Democratic Vote Share
***********************	
reghdfe ele025 c.irca_std##ib1992.year if year >1980, a($fe) nocons cluster($cluster) noomit
		forval i =1984(4)2000{
			local j `j' `i'.year#c.irca_std="`i'" 
			}
		global coeflabel_legalized "`j'"	
		
		global coefoptions  drop(_cons *.year irca_std) ///
			order( ///
				c.irca_std#96.congress c.irca_std#97.congress  c.irca_std#98.congress  c.irca_std#99.congress c.irca_std#100.congress c.irca_std#101.congress ) omitted ///
				ciopts(recast(rcap) lcolor(gs8)) msymbol(smcircle) ytitle("") baselevels title("", size(normal)) ///
				levels(95) byopts(legend(off) row(1)) xlabel(,labsize(small) angle(45))  xtitle("", size(normal)) ylab(, nogrid) ///
				coeflabels(${coeflabel_legalized})	yline(0, lcolor(gs8)) vertical title(" ")
				coefplot, $coefoptions 	

		graph save "fig3.gph", replace
		graph export "fig3.pdf", replace	
		
		
